package team.seekers.catering.common.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

import java.util.Arrays;

@Getter
public enum MessageEnum {

    END_COOKING(0, "CfebW0YTdzFe7LPfV2MS39LHmVr0bvuRttgOzqhjHlE","线下取餐通知");

    @EnumValue
    private int type;

    private String code;

    private String description;

    MessageEnum(int type, String code, String description) {
        this.type = type;
        this.code = code;
        this.description = description;
    }

    public Integer getValue() {
        return this.type;
    }

    public static MessageEnum getByType(int type) {
        return Arrays.stream(values()).filter(e -> e.getType() == type).findFirst().orElse(null);
    }
}

